<?php
/**
 * +----------------------------------------------------------------------
 * | 表单验证器
 * +----------------------------------------------------------------------
 *                      _ooOoo_
 *                     o8888888o            | AUTHOR: 杜云
 *                     88" . "88            | EMAIL: 987772927@qq.com
 *                     (| -_- |)            | QQ: 987772927
 *                     O\  =  /O            | WECHAT: 987772927
 *                  ____/`---'\____
 *                .'  \\|     |//  `.
 *               /  \\|||  :  |||//  \
 *              /  _||||| -:- |||||-  \
 *              |   | \\\  -  /// |   |
 *              | \_|  ''\-/''  |   |
 *              \  .-\__  `-`  ___/-. /
 *            ___`. .'  /-.-\  `. . __
 *         ."" '<  `.___\_<|>_/___.'  >'"".
 *        | | :  `- \`.;`\ _ /`;.`/ - ` : | |
 *        \  \ `-.   \_ __\ /__ _/   .-` /  /
 *   ======`-.____`-.___\_____/___.-`____.-'======
 *                      `=-='
 * +----------------------------------------------------------------------
 */
declare(strict_types=1);
namespace App\Request;

use Hyperf\Validation\Request\FormRequest;
use Hyperf\Validation\Rule;
class AppVerRequest extends FormRequest
{

    public function authorize(): bool
    {
        return true;
    }
    public function rules(): array
    {
        return [
            'id' => ['required'],
            'edition_name' => 'required|max:255|unique:app_vers',
            'edition_number' => 'required|numeric|unique:app_vers',
            'version_type' => 'required',
            'edition_url' => 'required',
        ];
    }
    public function attributes(): array
    {
        return [
            'edition_name' => '版本名称',
            'edition_number' => '版本号',
            'version_type' => '版本类型',
            'edition_url' => '包地址',
        ];
    }
    public function messages(): array
    {
        return [
        ];
    }
    protected $scenes = [
        'add' => ['edition_name','edition_number','version_type','edition_url'],
        'edit' => ['id','version_type','edition_url'],
    ];
}
